import request from "@/utils/request.js";

export const login = (data) => {
	return request({
		url: "/mini/loginMini",
		data,
		method: "GET",
	});
};

// 获取用户信息
export const getUserInfo = (data) => {
	return request({
		url: "/mini/userInfo",
		method: "GET",
		data,
	});
};
// 修改用户信息
export const updateUser = (data) => {
	return request({
		url: "/mini/updateUserInfo",
		method: "POST",
		data,
	});
};

// 注册
export const register = (data) => {
	return request({
		url: "/mini/register",
		method: "POST",
		data,
	});
};

// 用户协议
export const proxy = (data) => {
	return request({
		url: "/index/common/getConfigByKeys?keys=" + data,
		method: "GET",
	});
};

// 商品列表
export const getProductLit = (data) => {
	return request({
		url: "/index/goodsPage",
		method: "GET",
		data,
	});
};

// 商品分类
export const productCate = (data) => {
	return request({
		url: "/index/category",
		method: "GET",
		data,
	});
};

// 发布
export const publish = (data) => {
	return request({
		url: "/index/publish",
		method: "POST",
		data,
	});
};

// 发布
export const wPublish = (data) => {
	return request({
		url: "/index/takingPublish",
		method: "POST",
		data,
	});
};

// 商品详情
export const productDetail = (data) => {
	return request({
		url: "/index/goods/" + data,
		method: "GET",
	});
};

// 接单
export const takeOrder = (data) => {
	return request({
		url: "/index/taking",
		method: "POST",
		data
	});
};

// 支付
export const payment = (data) => {
	return request({
		url: "/index/pay",
		method: "POST",
		data
	});
};

// 收藏
export const collect = (data) => {
	return request({
		url: "/index/collect",
		method: "POST",
		data
	});
};

// 收藏列表
export const collectList = (data) => {
	return request({
		url: "/home/collectPage",
		method: "GET",
		data,
	});
};

// 议价
export const bargaining = (data) => {
	return request({
		url: "/index/price",
		method: "POST",
		data,
	});
};

// 议价列表
export const bargainingList = (data) => {
	return request({
		url: "/index/pricePage",
		method: "GET",
		data,
	});
};

// 选择他

export const select = (data) => {
	return request({
		url: "/index/change",
		method: "GET",
		data,
	});
};

//接单求助
export const jqList = (data) => {
	return request({
		url: "/home/taking",
		method: "GET",
		data,
	});
};

//购买出售
export const gcList = (data) => {
	return request({
		url: "/home/goods",
		method: "GET",
		data,
	});
};

// 完成
export const completed = (data) => {
	return request({
		url: "/home/finish",
		method: "GET",
		data,
	});
};

// 取消
export const cancel = (data) => {
	return request({
		url: "/home/cancel",
		method: "GET",
		data
	});
};

// 提现
export const withdrawal = (data) => {
	return request({
		url: "/home/withdrawal",
		method: "GET",
		data
	});
};

// 消息
export const msgList = (data) => {
	return request({
		url: "/home/noticeList",
		method: "GET",
		data,
	});
};

// 消息详情
export const msgDetail = (data) => {
	return request({
		url: "/home/noticeInfo/" + data,
		method: "GET",
	});
};


// showSelect
export const showSelect = (data) => {
	return request({
		url: "/index/showButton/" + data,
		method: "GET",
	});
};

// 获取验证码
export const getPhoneCode = (data) => {
	return request({
		url: "/mini/sms",
		method: "GET",
		data
	});
};